#ifndef _TAN_CODE_PARSER_H_
#define _TAN_CODE_PARSER_H_

#include "tan_code_snippet.h"
#include "tan_code_tool.h"

TANLIST(TanCode*) parser_codes(TANLIST(char*) codes, const char* file);

TanCodeBlock* parser_Declare(TANLIST(char*) codes, int* find_index, const int block_index, const bool hasparent);
TanCodeBlock* class_declare(TANLIST(char*) codes, int* find_index, const bool hasparent);
TanCodeBlock* function_declare(TANLIST(char*) codes, int* find_index, const bool hasparent);
TanCodeBlock* enum_declare(TANLIST(char*) codes, int* find_index, const bool hasparent);

TanCodeBlock* if_declare(TANLIST(char*) codes, int* find_index);
TanCodeBlock* elif_declare(TANLIST(char*) codes, int* find_index);
TanCodeBlock* else_declare(TANLIST(char*) codes, int* find_index);

TanCodeBlock* for_declare(TANLIST(char*) codes, int* find_index);
TanCodeBlock* while_declare(TANLIST(char*) codes, int* find_index);

int ifcode_block(const char* code);

TANLIST(TanCode*) stringToCode(TANLIST(char*) codes);


//

TanCode* read_code(const char* one_code);

TanCode* parser_symbol(const char* code);
TANLIST(TanCode*) more_code(const char* code);
TanCode* read_more(const char* code);
TanCode* parser_dot(const char* code);
TanCode* parser_constant(const char* code);
TanCode* parser_string(const char* code);
TanCode* parser_runblock(const char* code);
TanCode* parser_var(const char* code);

bool ifcode_symbol(const char* code);
bool ifcode_more(const char* code);
bool ifcode_dot(const char* code);
bool ifcode_runblock(const char* code);
bool ifcode_constant(const char* code);
bool ifcode_string(const char* code);

char* get_dot_name(const char* code);


#endif //!_TAN_CODE_PARSER_H_
